import request from '@/utils/request'
import axios from 'axios';

export function listAuxiliaryDecision(query) {
  return request({
    url: '/auxiliaryDecision/getPage',
    method: 'get',
    params: query
  })
}
export function getScenarios(id) {
  return request({
    url: '/auxiliaryDecision/getDisasterScenario?id='+id,
    method: 'get'
  })
}
export function getEmergency(id) {
  return request({
    url: '/auxiliaryDecision/getEmergencyResponse?id='+id,
    method: 'get'
  })
}
export function updateData() {
  return request({
    url: '/auxiliaryDecision/save',
    method: 'post',
  })
}

// 新增
export function updateList1(data) {
  return request({
    url: '/auxiliaryDecision/updateErcmEntityById',
    method: 'post',
    data: data
  })
}

export function updateList2(data) {
  return request({
    url: '/auxiliaryDecision/updateDisasterSceneById',
    method: 'post',
    data: data
  })
}
// 获取报告模板
export function getReportTemplateByType(rtType) {
  return request({
    url: `/fxfzypg/report/getReportTemplateByType?rtType=${rtType}`,
    method: "get"
  })
}
export function reportCreat(data, cancel) {
  return request({
    url: '/auxiliaryDecision/createReport',
    method: "post",
    data: data,
    cancelToken: new axios.CancelToken(function executor(c) {
      cancel.c = c;
    })
  });
}
export function getReport(id) {
  return request({
    url: '/auxiliaryDecision/getReport?id='+id,
    method: 'get'
  })
}